/**
 * Project Name:FriedGoldenFlower
 * File Name:ActivityMain.java
 * Package Name:com.snail.activity
 * Date:May 19, 20137:48:08 PM
 * Copyright (c) 2013, lilinfeng.abel@gmail.com All Rights Reserved.
 *
 */
package com.snail.activity;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.snail.fragment.FragmentGameHallPrimary;
import com.snail.fragment.FragmentMain;
import com.snail.fragment.FragmentMain.OnGameTypeClicked;

/**
 * ClassName: ActivityMain <br/>
 * Function: TODO 首页 <br/>
 * Reason: TODO ADD REASON(可选). <br/>
 * date: May 19, 2013 7:48:08 PM <br/>
 * 
 * @author lilinfeng.abel@gmail.com
 * @version
 * @since JDK 1.6
 */
public class ActivityMain extends FragmentActivity implements OnGameTypeClicked {

	private Button btnRegist,btnFindSeat;
	private FragmentManager mFragMgr;
	private LinearLayout llContent;
	private TextView tvOnlineSum;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_main);
		btnRegist = (Button) findViewById(R.id.btnMainTopRegist);
		llContent = (LinearLayout) findViewById(R.id.llMainContentContainer);
		btnFindSeat = (Button)findViewById(R.id.btnMainBottomFindSeat);
		tvOnlineSum = (TextView)findViewById(R.id.tvMainOnline);
		mFragMgr = getSupportFragmentManager();
		FragmentTransaction trans = mFragMgr.beginTransaction();
		trans.add(R.id.llMainContentContainer, new FragmentMain(), "main");
		trans.commit();
		btnRegist.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {

			}
		});
	}

	/**
	 * TODO 快速开始被选中.
	 * 
	 * @see com.snail.fragment.FragmentMain.OnGameTypeClicked#onQuickStartClick(android.view.View)
	 */
	@Override
	public void onQuickStartClick(View v) {

		// TODO Auto-generated method stub

	}

	/**
	 * TODO 游戏大厅被选中.
	 * 
	 * @see com.snail.fragment.FragmentMain.OnGameTypeClicked#onGameHallClick(android.view.View)
	 */
	@Override
	public void onGameHallClick(View v) {
		FragmentGameHallPrimary gameHall = new FragmentGameHallPrimary();
		final FragmentTransaction trans = mFragMgr.beginTransaction();
		trans.replace(R.id.llMainContentContainer, gameHall);
		trans.addToBackStack(null);
		trans.commit();
		btnFindSeat.setVisibility(View.VISIBLE);
		tvOnlineSum.setVisibility(View.INVISIBLE);
	}

	/**
	 * TODO 风云赛事被选中
	 * 
	 * @see com.snail.fragment.FragmentMain.OnGameTypeClicked#onGameEvent(android.view.View)
	 */
	@Override
	public void onGameEvent(View v) {

		// TODO Auto-generated method stub

	}
}
